<?php
/**
 * 
 * @author wb_wenjie.wuwj <wb_wenjie.wuwj@alibaba-inc.com>
 * @copyright 2013-3-28 yahoo
 */

class RequireLogin extends CBehavior
{
	public function attach($owner)
	{
		$owner->attachEventHandler('onBeginRequest', array($this, 'handleBeginRequest'));
	}
	
	public function handleBeginRequest()
	{
		//var_dump($_GET);
		if (Yii::app()->user->isGuest && (!isset($_GET['r']) || $_GET['r'] == 'login'))
		{
			//Yii::app()->user->loginRequired();
		}
	}
}